/** 目录树结构 */
export type IFolder = {
  id: string,
  name: string,
  children: [IFolder]
}

/** 文件传输展示类型 */
export enum ShowEnum {
  PUBLIC = 0,   // 公共
  USER = 1,     // 用户
  RECYCLE = 2   // 回收站
}

/** 文件传输判断 */
export const isPublic = (show: ShowEnum): boolean => {
  return show === ShowEnum.PUBLIC;
}
export const isUser = (show: ShowEnum): boolean => {
  return show === ShowEnum.USER;
}
export const isRecycle = (show: ShowEnum): boolean => {
  return show === ShowEnum.RECYCLE;
}

/** 目录权限 */
export enum Power {
  PRIVATE = 'private',
  PUBLIC = 'public',
  COMMON = 'common'
}

/** 转换权限为中文说明 */
export const converterPower2DescName = power => {
  switch (power) {
    case Power.COMMON:
      return '公共';
    case Power.PUBLIC:
      return '公开';
    case Power.PRIVATE:
      return '私有';
    default:
      return '--';
  }
}

